/**
 * 
 */
package org.purview;

import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.jstl.core.ConditionalTagSupport;

/**
 * 权限检查标签
 * @author yue
 * 2016年7月12日 下午11:36:26
 */
public class CheckPurview extends ConditionalTagSupport{
	private static final long serialVersionUID = 3795832989096929550L;
	private boolean rest;
	/**
	 * 
	 */
	public CheckPurview() {
		super();
		init();
	}
	
	 private void init() {
		 rest = false;
     }

	/* 
	 * @return
	 * @throws JspTagException 
	 */
	@Override
	protected boolean condition() throws JspTagException {
		return rest;
	}

	public void setTest(String test) {
		Object user = pageContext.getSession().getAttribute("user");
		//根据test中内容检查权限
		if(test.equals("yes")){
			this.rest = true;
		}else{
			this.rest = false;
		}
	}
	
	

	
}
